package message.types.stalker;

import java.io.IOException;

import message.visitor.MessageVisitor;
import network.e2e.FrameReader;
import stalker.Stalker;

/**
 * Acknowledges a successful login attempt
 */

public class CreateRoomSuccessAnswer extends StalkerMessage {
  
  /**
   * Creates a new create room success acknowledgement for the corresponding id
   */
  public CreateRoomSuccessAnswer(Stalker client, Stalker destination, Stalker credential) {
    super(client, destination, credential);
  }
  
  /**
   * Retrieves this message over the net
   * @throws IOException 
   */
  public CreateRoomSuccessAnswer(Stalker client, Stalker destination, FrameReader reader) throws IOException {
    super(client, destination, reader);
  }
  
  @Override
  public <T> T accept(MessageVisitor<T> visitor) {
    return visitor.visit(this);
  }

  @Override
  public boolean equals(Object obj) {
    if (!(obj instanceof CreateRoomSuccessAnswer)) {
      return false;
    }
    return super.contentEquals(obj);
  }

  @Override
  public String toString() {
    return "CreateRoomSuccessAnswer for " + this.getCredential();
  }

}
